<div id='to_bind'>
<?php echo Form::open(array('action' => '/bind/add', 'name' => 'add', 'method' => 'post', 'id' => 'add', 'class' => 'form-inline'));?>
<?php echo Form::input('account', '', array('autocomplete' => 'off', 'id' => 'account', 'size' => '20', 'type' => 'text', 'class'=> 'input-big', 'placeholder'=>'微博账号'));?>
&nbsp;
<?php echo Form::input('password', '', array('id' => 'password', 'size' => '20', 'type' => 'password', 'class'=> 'input-big', 'placeholder'=>'密码'));?>
&nbsp;
<?php echo Form::input('submit', '绑定', array('id' => 'submit', 'type' => 'submit', 'class'=>'btn btn-success'));?>
<?php echo Form::close(); ?>
</div>

<table class='table table table-striped table-bordered table-condensed'>
<thead>
<tr>
<th class='profile_image_url'>头像</th>
<th class='screen_name'>昵称</th>
<th class='followers_count'>粉丝数</th>
<th class='friends_count'>关注数</th>
<th class='statuses_count'>微博数</th>
<th class='description'>描述</th>
</tr>
</thead>
<tbody>
<?php foreach ($account as $k => $v) {?>
<tr>
<?php echo "<td class='profile_image_url'><a target='_blank' href='http://weibo.com/u/{$v['idstr']}/'><img src='{$v['profile_image_url']}' width=50 height=50 /></a></td>";?>	
<?php echo "<td class='screen_name'><a href='http://weibo.com/u/{$v['idstr']}' target='_blank'>{$v['screen_name']}</a></td>";?>	
<?php echo "<td class='followers_count'>{$v['followers_count']}</td>";?>	
<?php echo "<td class='friends_count'>{$v['friends_count']}</td>";?>	
<?php echo "<td class='statuses_count'>{$v['statuses_count']}</td>";?>	
<?php echo "<td class='description'>{$v['description']}</td>";?>	
</tr>
<?php } ?>
</tbody>
</table>
<style>
td.item{
vertical-align:middle;
}
td.description{
width:40%;
}
td.profile_image_url{
width:55px;
}
</style>
<script>
$('#add').submit(function() {
var account = $('#account').val();
var password = $('#password').val();
if (0 == password.length || 0 == account.length) {
	alert('用户名或密码为空~');
} else {
	$.post('/bind/cb', {'account': account, 'password': password}, function(v) {
		if (v.msg == 'succ') {
			window.location.reload();
		} else {
			alert('添加失败');
		}
	}, 'json');
}
return false;
});
</script>
